<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script type="text/javascript">
        var array1 = [1, 2, 3, 4,5,6];
        var array2 = [7, 8, 9];
        var array = array1.concat(array2);
        //自定义函数，输出数组中所有的数据
        function writeArr(arrname,sp) {
            for(var i= 0 ;i<arrname.length;i++) {
                document.write(arrname[i]);
                document.write(sp);
            }
            document.write("<br/>");
        }
        document.write("数组1：");
        writeArr(array1, ",");
        document.write("数组2：");
        writeArr(array2, ",");
        document.write("数组3：");
        writeArr(array, ",");

    </script>
</head>
<body>

</body>
</html>